<?php
include '../dbconfig/config.php';
include '../dbconfig/opendb.php';
include '../util/dbutil.php';
include 'genreport.php';

function redirect($url) {
    echo "<html>";
    echo "<head>";
    echo "<meta http-equiv=\"REFRESH\" content=\"0;url=$url\">";
    echo "</head>";
    echo "</html>";
}

$org = $_GET['org'];
$ref = $_GET['ref'];
$type = $_GET['type'];

if ($type=="pro") {
    redirect(getProteinReport($org,$ref));
} elseif($type=="site") {
    redirect(getSiteReport($org,$ref));
}elseif($type=="nrpep") {
    redirect(getNrPepReport($org,$ref));
}elseif($type=="spec") {
    redirect(getSpectrumReport($org,$ref));
//    echo "<a href=\"".getSpectrumReport($org,$ref)."\">test</a>";
}

include '../dbconfig/closedb.php';

?>
